#ifndef QWIDGET_PLAYVIDEO_H
#define QWIDGET_PLAYVIDEO_H

#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QPushButton>
#include <QSlider>
#include <QDebug>
#include <QMouseEvent>
#include <QSpacerItem>
#include <QThread>
#include "ffmpegvideo.h"

class QWidget_PlayVideo : public QWidget
{
    Q_OBJECT
public:
    explicit QWidget_PlayVideo(QWidget *parent = nullptr);
    ~QWidget_PlayVideo() override;
    QImage image;

    void paintEvent(QPaintEvent *) override; ///< 窗体重绘

    FFmpegVideo * m_FFmpegVideo;            ///< 视频类
    QThread * m_PlayThread;                 ///< 播放线程

    /// 界面布局相关
    QVBoxLayout *m_Vlayout; ///< 垂直布局
    QHBoxLayout *m_Hlayout; ///< 水平布局
    QPushButton *m_btn_startorstop;  ///< 开始暂停按钮
    QSlider *m_slider;      ///< 滑块进度条 - 显示视频播放进度

    bool b_slidermoved = false;   ///< 滑动条是否移动 (手动)

signals:

public slots:
    void slot_RecvOneFrame(QImage im); ///< 接收一张图片

protected:
    void mouseMoveEvent(QMouseEvent *event) override;  ///< 鼠标移动事件
};



#endif // QWIDGET_PLAYVIDEO_H
